// eslint-disable-next-line
import { BasicLayout } from '@/layouts'
// import * as Icons from '@/core/icons'

// const RouteView = {
//   name: 'RouteView',
//   render: (h) => h('router-view')
// }

/**
 * 路由配置说明：
 * 建议：sider menu 请不要超过三级菜单，若超过三级菜单，则应该设计为顶部主菜单 配合左侧次级菜单
// {
//   redirect: noredirect,  //重定向
//   name: 'router-name',   //路由名称
//   hidden: true,          //可以在菜单中不展示这个路由，包括子路由。效果可以查看 other 下的路由配置。
//   meta: {
//     title: 'title',      //菜单项名称
//     icon: 'a-icon',      //菜单项图标
//     keepAlive: true,     //缓存页面
//     permission：[string]   //用来配置这个路由的权限，如果配置了将会验证当前用户的权限，并决定是否展示 *（默认情况下）
//   }
// }
 **/

/**
 * 基础路由
 * @type { *[] }
 */
export const constantRouterMap = [
  
  // 首页
  { 
    path: '/',
    name:'root',
    redirect: '/index',
    component: BasicLayout,
    children:[
      {
        path:'/index',
        name: 'index',
        component: () => import('@/views/index/Index'),
        meta: { title: '首页',requiresAuth:true, keepAlive: true, permission: ['/index'] }
      },
      
      
      // { 
      //   path: '/list', 
      //   component: () => import( '@/views/list/List'),
      //   meta: { title: '列表页',requiresAuth:true,  keepAlive: true, permission: ['/list'] }
      // },
      
      { 
        path: '/mine', 
        component: () => import( '@/views/mine/Index'),
        meta: { title: '个人中心',requiresAuth:true,  keepAlive: true, permission: ['/mine'] },
      },
      { path: '/signList',meta:{title: '我的报名',requiresAuth:true,keepAlive: true}, component: () => import('@/views/mine/List')},
    ]
    
  },

  { path: '/news',meta:{title: '资讯',requiresAuth:true,}, component: () => import('@/views/news/Index')},
  { path: '/sign',component: () => import( '@/views/sign/Index'), meta: { title: '考试报名',requiresAuth:true,  keepAlive: true, permission: ['/sign'] }},
  { path: '/profile',meta:{title: '我的资料',requiresAuth:true,keepAlive: true}, component: () => import('@/views/mine/Profile')},
  { path: '/pay',meta:{title: '支付',requiresAuth:true,keepAlive: true,}, component: () => import('@/views/sign/Pay')},
  { path: '/upload',meta: { title: '作品上传',requiresAuth:true,  keepAlive: true}, component: () => import( '@/views/sign/Upload')},
  { path: '/detail',meta: { title: '考试结果',requiresAuth:true,  keepAlive: true}, component: () => import( '@/views/sign/Detail')},
  { path: '/grading',meta:{title: '我的考级',requiresAuth:true,keepAlive: true}, component: () => import('@/views/mine/Grading')},
  { path: '/cert',meta:{title: '我的证书',requiresAuth:true,keepAlive: true}, component: () => import('@/views/mine/Cert')},
  { path: '/code',meta:{title: '考级卡申请',requiresAuth:true,keepAlive: true}, component: () => import('@/views/mine/Code')},
  { path: '/mecode',meta:{title: '我的考级卡',requiresAuth:true,keepAlive: true}, component: () => import('@/views/mine/Mecode')},
  { path: '/ticket',meta:{title: '准考证下载',requiresAuth:true,keepAlive: true}, component: () => import('@/views/mine/Ticket')},
 
  { path: '/info',meta:{title: '详情',requiresAuth:true,}, component: () => import('@/views/news/Info')},
  { path: '/notice',meta:{title: '公告',requiresAuth:true,}, component: () => import('@/views/pages/Notice')},
  
  // 用户登录页
  { path: '/passport/login',meta:{title: '登录',requiresAuth:false,}, component: () => import('@/views/passport/Login')},
  { path: '/passport/reg',meta:{title: '注册',requiresAuth:false,}, component: () => import('@/views/passport/Reg')},
  { path: '/test',meta:{title: '测试表单',requiresAuth:false,}, component: () => import('@/views/passport/Test')},

  // 404页
  { path: '/404', meta:{title: '404',requiresAuth:false,},component: () => import('@/views/exception/404')}

]
